# -*- coding: utf-8 -*-

# Scrapy settings for baidu project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
#     http://doc.scrapy.org/en/latest/topics/settings.html
#

BOT_NAME = 'baidu'

SPIDER_MODULES = ['baidu.spiders']
NEWSPIDER_MODULE = 'baidu.spiders'
DOWNLOAD_DELAY = 1
RANDOMIZE_DOWNLOAD_DELAY = True
COOKIES_ENABLES = False
#CONCURRENT_REQUESTS = 100
MONGODB_SERVER = '127.0.0.1'
MONGODB_PORT = 54545
MONGODB_DB = 'baidu'

DOWNLOADER_MIDDLEWARES = {
'scrapy.contrib.downloadermiddleware.useragent.UserAgentMiddleware' : None,
'baidu.spiders.common_agent.RotateUserAgentMiddleware' :400
#'kickstart.spiders.common_agent.ProxyMiddleware' :410
#'kickstart.spiders.randomproxy.RandomProxy' :200
}

ITEM_PIPELINES = {
'baidu.pipelines.BaiduPipeline': 100
}

# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'baidu (+http://www.yourdomain.com)'
